import * as React from 'react'
import { BrowserRouter, Route, Switch } from 'react-router-dom'
import main from '../Main'
import open from '../Open'
import put from '../Put'
import put_done from '../Put_done'

export default class App extends React.Component {
    render() {
        return (
            <BrowserRouter>

                    {/* 根据URL路径匹配路由组件，渲染到该位置 */}
                    <Switch>
                        <Route path='/' exact component={main} />
                        <Route path='/put' component={put} />
                        <Route path='/put_done' component={put_done} />
                        {/*<Route path='/open/:id' component={open} />*/}
                        <Route path='/open' component={open} />
                        {/* 这是一个默认页面，如果前面的路由都没有被匹配到，就会渲染这个组件，相当于404，一定要放到最后 */}
                        {/*<Route component={} />*/}
                    </Switch>

            </BrowserRouter>
        )
    }
}